﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Farigola.Engine.SystemData.DataValue
{
    /// <summary>
    /// Represents an integer data value.
    /// </summary>
    public class DataValueInt : DataValueBase
    {
        /// <summary>
        /// The string data value.
        /// </summary>
        private int _value;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="value"></param>
        public DataValueInt()
        {
            this.DataValueType = DataValue.DataValueType.Int;

            // init to empty (not to null)
            _value = 0;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="value"></param>
        public DataValueInt(int value)
        {
            this.DataValueType = DataValue.DataValueType.Int;
            _value = value;
        }

        /// <summary>
        /// Set a new string value. 
        /// </summary>
        /// <param name="val"></param>
        /// <returns></returns>
        public bool SetValue(int val)
        {
            // can be null?
            // todo:

            _value = val;
            return true;
        }

        /**
         * return the string value.
         * 
         * @return
         */
        public int GetValue()
        {
            return _value;
        }
    }
}
